About Data Modelling
Data Modelling is the foundational process of creating a visual or structural representation of either a whole information system or parts of it to communicate connections between data points and structures.
1. What is Data Modelling?
At its core, data modelling is the act of designing the schemas and relationships that determine how data is stored, queried, and managed within a database. It bridges the gap between complex business requirements and the technical implementation in a database system.
Why is it Important?
- Clarity & Communication: It acts as a blueprint that both business stakeholders and technical developers can understand.
- Data Integrity: A good data model enforces rules (like constraints and keys) that prevent data corruption and duplication.
- Performance: Well-modeled data ensures queries run efficiently, which is critical as databases scale to terabytes or petabytes.
2. The Data Modelling Process
Data modelling is typically done in three distinct phases, moving from high-level business abstraction down to low-level technical implementation:
- Conceptual Model: Identifies the highest-level relationships between different entities. (e.g., A Customer places an Order).
- Logical Model: Defines the structure of the data elements and relationships in detail, independent of any specific database engine. (e.g., Customer has Customer_ID, Name, Email. Order has Order_ID, Date, Customer_ID).
- Physical Model: Defines exactly how the data will be stored in a specific database system (e.g., PostgreSQL, MongoDB). This includes choosing exact data types, setting up primary/foreign keys, and creating indexes.
3. Key Terminology
Note
Understanding these terms is essential for both relational (SQL) and non-relational (NoSQL) modelling.
- Entity: A real-world object or concept (e.g.,
User,Product,Account). In a relational database, this becomes a Table. - Attribute: A property or trait of an entity (e.g.,
user_id,email,created_at). In a relational database, this becomes a Column. - Relationship: The association between two entities.
- 1:1 (One-to-One): A user has one profile.
- 1:N (One-to-Many): A user can have many orders.
- M:N (Many-to-Many): Students can enroll in many classes, and classes can have many students.
- Primary Key (PK): A unique identifier for a specific record in an entity (e.g.,
user_id = 101). - Foreign Key (FK): An attribute in one entity that links to the Primary Key of another entity, creating a relationship.
- Normalization: The process of organizing data to minimize redundancy and dependency (used primarily in traditional relational models).
- Denormalization: The process of intentionally duplicating data to improve read performance (used heavily in NoSQL and analytical Data Warehouses).